home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / libs / tool7v13 / demomen.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1994-09-25  |  1.6 KB  |  59 lines

  1. Program MenuDemo;
  2.  
  3. { Purpose....... Demonstrates the use of the following units: mouse
  4.   Comments...... None
  5.   Author........ Thayne Breetzke
  6.   Date.......... 31 March 1994                                               }
  7.  
  8. Uses
  9.   Crt,
  10.   Mouse;
  11.  
  12. Const
  13.   Options: Array[1..8,1..4] of Word =
  14.            ((8,0,0,0),
  15.             (25,56,0,0),
  16.             (89,120,0,0),
  17.             (153,176,0,0),
  18.             (209,264,0,0),
  19.             (297,352,0,0),
  20.             (385,424,0,0),
  21.             (457,544,0,0));
  22.  
  23. Var
  24.   Button: Byte;
  25.   Index: Word;
  26.  
  27. Begin
  28.   ClrScr;
  29.   If not MInstalled then
  30.     Writeln('Sorry, you need a mouse to run this demo...')
  31.   else
  32.     Begin
  33.       Writeln('    File    Edit    Run    Compile    Options    Debug    Break/watch');
  34.       GotoXY(12,10);
  35.       Writeln('╔════════════════════════════════════════════════════╗');
  36.       GotoXY(12,11);
  37.       Writeln('║ Select an option by pressing the left mouse button ║');
  38.       GotoXY(12,12);
  39.       Writeln('╚════════════════════════════════════════════════════╝');
  40.       GotoXY(1,1);
  41.       ShowMouse;
  42.       Repeat
  43.         Button := ButtonPressed;
  44.         Index := MouseLocate(Options)
  45.       until (Button = 1) and (Index in [1..7]);
  46.       HideMouse;
  47.       ClrScr;
  48.       Write('You selected option ',Index,' (');
  49.       Case Index of
  50.         1:  Writeln('File)');
  51.         2:  Writeln('Edit)');
  52.         3:  Writeln('Run)');
  53.         4:  Writeln('Compile)');
  54.         5:  Writeln('Options)');
  55.         6:  Writeln('Debug)');
  56.         7:  Writeln('Break\watch)')
  57.       end
  58.     end
  59. end.